<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title></title>
[#import "/admin/include/admin_pagination.ftl" as p/]
[#include "/admin/include/admin_static.htm"]
    <script type="text/javascript">

        layui.use('form', function(){
            var form = layui.form(), $=layui.jquery, layer = layui.layer;
            form.on('switch(switch)', function(data){
                console.log(data.elem.checked); //开关是否开启，true或者false
                if(data.elem.checked){
                    $('#status').val(1);
                }else{
                    $('#status').val(-1);
                }
            });
            form.on('submit(success)', function(data){
                var index = layer.load();
                ajax({
                    url:"${path}/admin/approve/save.aspx",
                    data: data.field,
                    success: function(result){
                        layer.msg(result.content,{time:500}, function(){
                            location.href='${path}/admin/approve/list.aspx';
                        });
                        layer.close(index);
                    },
                    complete:function(){
                        layer.close(index);
                    },error:function(){
                        layer.close(index);
                    }
                });
                return false;
            });

        });

    </script>

</head>
<body>
	<div class="main_admin_content">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>实名审核</legend>
        </fieldset>
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">用户名:</label>
                <div class="layui-input-block">
                    <input type="text"  readonly autocomplete="off" value="${user.user_name }" class="layui-input">
                </div>
				</div>
            <div class="layui-form-item">
                <label class="layui-form-label">真实姓名：</label>
                <div class="layui-input-block">
                    <input type="text"  readonly autocomplete="off" value="${(realName.real_name)!'' }" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身份证号码：</label>
                <div class="layui-input-block">
                    <input type="text" readonly autocomplete="off" value="${(realName.id_number)!'' }" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">生日:</label>
                <div class="layui-input-block">
                    <input type="text"  readonly autocomplete="off" value="${(realName.birthdate)!''}" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">申请时间：</label>
                <div class="layui-input-block">
                    <input type="text" readonly autocomplete="off" value="${p2p_date_format((realName.addtime)!'' ,"yyyy-MM-dd HH:mm:ss")}" class="layui-input">
                </div>

            </div>
            <div class="layui-form-item">

                <label class="layui-form-label">身份证照片：</label>
                <div class="layui-input-block">
                    <img src="${realName.card_pic1}" alt="" style="width: 360px;height: 160px;" />
                    <img src="${realName.card_pic2}" alt="" style="width: 360px;height: 160px;" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">状态：</label>
                <div class="layui-input-block">

<input type="text" readonly autocomplete="off" value="[#if realName.status==0 ]申请中[#elseif  realName.status==1 ]已通过[#else]未通过[/#if]" class="layui-input">

            </div>
				<input style="display: none" name="id" value="${realName.id}">

                <div class="layui-form-item">
                    <label class="layui-form-label">是否同意</label>
                    <div class="layui-input-block">
                        <input name="status" id="status" value="1" style="display: none">
                        <input type="checkbox" name="isagree" lay-skin="switch" lay-text="同意|拒绝" lay-filter="switch"  value="1" [#if realName.status==0] checked="checked" [#else]  [#if realName.status==1]checked="checked" disabled[#else] disabled [/#if]  [/#if]>
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">审核备注</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入备注"   [#if realName.status==0]  [#else]disabled[/#if] required lay-verify="required" class="layui-textarea" name="remark"  >${realName.remark }</textarea>
                    </div>
                </div>

                <div class="layui-form-item layui-form-text">
                    <div class="layui-input-block">
					[#if realName.status==0]
                        <button  lay-submit lay-filter="success" class="layui-btn " [#if realName.status==0]  [#else]disabled[/#if]    />审核</buttton>
					[#else]

                        [/#if]
                    </div>
                </div>

		</form>
	</div>

</body>
</html>